package com.jzo2o.customer.controller.operation;


import com.jzo2o.common.model.PageResult;
import com.jzo2o.common.model.dto.PageQueryDTO;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 服务人员认证审核表 前端控制器
 * </p>
 *
 * @author Echo
 * @since 2025-03-08
 */
@RestController("operationWorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "运营端 - 服务人员认证审核相关接口")
@RequiredArgsConstructor
public class WorkerCertificationAuditController {
    private final IWorkerCertificationAuditService auditService;

    @GetMapping("/page")
    @ApiOperation("分页查询服务人员认证信息")
    public PageResult<WorkerCertificationAuditResDTO> pageQuery(WorkerCertificationAuditPageQueryReqDTO dto) {
        return auditService.pageQueryWorker(dto);
    }

    @PutMapping("/audit/{id}")
    @ApiOperation("审核服务人员的认证申请")
    public void auditWorker(@PathVariable("id") Long id, CertificationAuditReqDTO dto) {
        auditService.auditWorker(id, dto);
    }
}
